package com.struts.business.action;

import com.struts.business.formbean.UserForm;
import com.struts.business.service.UserServiceImpl;
import com.struts.business.service.UserServiceImplTow;
import com.struts.core.annotation.Control;
import com.struts.core.annotation.ReqMapping;
import com.struts.core.annotation.Resource;

@Control
@ReqMapping("/userAction")
public class UserAction{
	public UserAction(){
	}
	//注入的变量名字要规范：跟类名一样只不过首字母小写否则注入失败
	@Resource
	private UserServiceImpl userServiceImpl; 
	@Resource
	private UserServiceImplTow userServiceImplTow;
	
	@ReqMapping("/user")
	public String excute(UserForm user){
		boolean tag = userServiceImplTow.isAdmin(user);
		boolean tag2 = userServiceImpl.isAdmin(user);
		if(tag && tag2){
			return "/success.jsp";
		}else{
			return "/error.jsp";
		}
	}
}
